﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI.WebControls;
using _DataProvider;

public partial class Admin_Parts_XemDSPDH : System.Web.UI.UserControl
{
    private SqlConnection connSql;
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = loaddsddh();
        GridView1.DataSource = dt;
        GridView1.DataBind();

    }

    public DataTable loaddsddh()
    {
        DataProvider dt = new DataProvider();
        connSql = dt.connect();
        SqlDataAdapter daDepart = null;
        daDepart = new SqlDataAdapter("Select * from PhieuDatHang", connSql);
        DataSet ds = new DataSet();
        daDepart.Fill(ds);
        return ds.Tables[0];
    }
    
    protected void Button1_Click(object sender, EventArgs e)
    {
        GridViewRow gr = GridView1.SelectedRow;
        Response.Redirect("~/Admin/XemCTPDH.aspx?MaPDH=" + gr.Cells[1].Text);
    }
}